<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="js/vue.js"></script>
  <style>
    /* 这个指令页面选择器，有这个属性就执行这个样式 */
    [v-cloak] {
      display: none;
    }
  </style>
</head>

<body>
  <h3>姓名（单值），年龄（单值），爱好（数组），女朋友（对象），豪车（对象数组）</h3>
  <div id="app" v-cloak>
    {{name}},{{age}}
    <hr>
    {{hobby}},{{hobby[0]}},{{hobby[1]}},{{hobby.length}},{{hobby[hobby.length-1]}}
    <hr>
    {{girlfriend}},{{girlfriend.name}},{{girlfriend.age}}
    <hr>
    {{cars[0].name}}
  </div>

  <script>
    var vm = new Vue({
      el: '#app',
      data: {
        name: "lqb",//字符串类型两边使用双引号或者单引号
        age: 18,//整数直接写
        hobby: ["乒乓", "爬山", "唱歌"],//字符串数组
        girlfriend: {
          name: "zyq",
          sex: "nv",
          age: 18
        },
        cars: [{ name: "劳斯莱斯", color: "white" },
        { name: "奔驰", color: "red" },
        { name: "宝马", color: "green" }
        ]
      },
      methods: {}
    });
  </script>
</body>

</html>